package com.example.fengyungo.dao;

import com.example.fengyungo.domain.pojo.OrderResult;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OrderResultDao {

    /**
     * 添加订单结果
     *
     * @param orderResult OrderResult
     * @return Integer
     */
    @Insert("insert into order_reult " +
            "(tradeStatus, outTradeNo, tradeNo, totalAmount) " +
            "VALUES " +
            "(#{tradeStatus}, #{outTradeNo}, #{tradeNo}, #{totalAmount})")
    Integer addOrderResult(OrderResult orderResult);

    /**
     * 根据订单号查询订单结果
     *
     * @param number String
     * @return OrderResult
     */
    @Select("select * from order_reult where outTradeNo = #{number}")
    OrderResult getOrderResultByOutTradeNo(String number);

}
